
package com.shanghai.punan;

import android.app.Activity;
import android.os.Bundle;
import android.telephony.gsm.SmsManager;
import android.util.Log;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class MainActivity extends Activity implements OnClickListener{
    public static final String TAG = "WatchDogMain";
    public static final int GETLOCATION = 1010;
    public static final int GETSMS = 1011;
    public static final int GETCALLS = 1012;
    
    private Button btn1;
    private Button btn2;
    private Button btn3;
    private Button btn4;
    private Button btn5;
    private Button btn6;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        
        btn1 = (Button)findViewById(R.id.button1);
        btn2 = (Button)findViewById(R.id.button2);
        btn3 = (Button)findViewById(R.id.button3);
        btn4 = (Button)findViewById(R.id.button4);
        btn5 = (Button)findViewById(R.id.button5);
        btn6 = (Button)findViewById(R.id.button6);
        
        btn1.setOnClickListener(this);
        btn2.setOnClickListener(this);     
        btn3.setOnClickListener(this);
        btn4.setOnClickListener(this);
        btn5.setOnClickListener(this);
        btn6.setOnClickListener(this);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.activity_main, menu);
        return true;
    }

    @Override
    public void onClick(View arg0) {
        // TODO Auto-generated method stub
        switch (arg0.getId())
        {
            case R.id.button1:
                Log.e(TAG, "button1 clicked, GetLocation...");
                //get location
                execCommand(GETLOCATION);
                break;
            case R.id.button2:
                Log.e(TAG, "button2 clicked");
                break;
            case R.id.button3:
                Log.e(TAG, "button3 clicked, GetSMS...");
                //get sms
                execCommand(GETSMS);
                break;
            case R.id.button4:
                Log.e(TAG, "button4 clicked");
                break;
            case R.id.button5:
                Log.e(TAG, "button5 clicked");
                //get calls
                execCommand(GETCALLS);
                break;
            case R.id.button6:
                Log.e(TAG, "button6 clicked");
                break;
            default:
                Log.e(TAG, "UNKNOW BUTTON");
                
        }
        
    }
    
    public void execCommand(int command)
    {
        
    }

}
